﻿using ConfExpert.Forms.Base;
using DevTeam;

using System;
using System.Data;

namespace ConfExpert.Forms.Depo.Kargo
{
    public partial class _KargoTarife : XForm
    {
        public _KargoTarife()
        {
            InitializeComponent();
        }

        private void KargoTarife_Load(object sender, EventArgs e)
        {
            
            gleKargoFirma.EditValueChanged += gleKargoFirma_EditValueChanged;
            gleKargoFirma.Edit.Assign(RI(Rp.Carrier));
        }

        int CarrierId = 0;
        void gleKargoFirma_EditValueChanged(object sender, EventArgs e)
        {
            CarrierId = gleKargoFirma.EditValue.ToInt();
            DataSet d = ExecuteDataSet("GetKargoTarife", CarrierId);
            gridView1.Init(d.Tables[0]);
            gridView2.Init(d.Tables[1]);
            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
        }
    }
}
